home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Development Tools & Languages / Dylan Related / Mindy-1.1 (sources only) / mindy-1.1 / libraries / dylan / cmp.dylan < prev    next >
Encoding:
Text File  |  1994-06-28  |  1.6 KB  |  58 lines  |  [TEXT/ttxt]

  1. module: Dylan
  2. rcs-header: $Header: cmp.dylan,v 1.5 94/06/27 17:10:16 wlott Exp $
  3.  
  4. //======================================================================
  5. //
  6. // Copyright (c) 1994  Carnegie Mellon University
  7. // All rights reserved.
  8. // 
  9. // Use and copying of this software and preparation of derivative
  10. // works based on this software are permitted, including commercial
  11. // use, provided that the following conditions are observed:
  12. // 
  13. // 1. This copyright notice must be retained in full on any copies
  14. //    and on appropriate parts of any derivative works.
  15. // 2. Documentation (paper or online) accompanying any system that
  16. //    incorporates this software, or any part of it, must acknowledge
  17. //    the contribution of the Gwydion Project at Carnegie Mellon
  18. //    University.
  19. // 
  20. // This software is made available "as is".  Neither the authors nor
  21. // Carnegie Mellon University make any warranty about the software,
  22. // its performance, or its conformity to any specification.
  23. // 
  24. // Bug reports, questions, comments, and suggestions should be sent by
  25. // E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  26. //
  27. //======================================================================
  28. //
  29. // This file contains the comparisons that arn't built in.
  30. //
  31.  
  32.  
  33. // Default methods for non-primitive compares.
  34.  
  35. define method \<= (x :: <object>, y :: <object>)
  36.   ~(y < x);
  37. end;
  38.  
  39. define method \~= (x :: <object>, y :: <object>)
  40.   ~(x = y);
  41. end;
  42.  
  43. define constant \>= =
  44.   begin
  45.     local method \>= (x :: <object>, y :: <object>)
  46.         ~(x < y);
  47.       end;
  48.     \>=;
  49.   end;
  50.  
  51. define constant \> =
  52.   begin
  53.     local method \> (x :: <object>, y :: <object>)
  54.         y < x;
  55.       end;
  56.     \>;
  57.   end;
  58.